﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using System.ServiceModel;
using IssueTracker.Business.BO;
using IssueTracker.Business.Entity;

namespace IssueTracker.Service
{
    [ServiceContract(Namespace="http://IssueTracker/service",  SessionMode=SessionMode.Allowed)]
    public interface IIssueTrackerService
    {

        [OperationContract]
        Project CreateProject(Project project);
        //[FaultContract(typeof(BusinessException))]

        [OperationContract]
        Project UpdateProject(Project project);

        [OperationContract]
        void DeleteProject(Project project);

        [OperationContract]
        IEnumerable<Project> ListProjects();

        [OperationContract]
        Project GetProject(int id);

        [OperationContract]
        ProjectCustomType CreateProjectCustomType(ProjectCustomType projectCustomType);

        [OperationContract]
        ProjectCustomType UpdateProjectCustomType(ProjectCustomType project);

        [OperationContract]
        void DeleteProjectCustomType(ProjectCustomType project);

        [OperationContract]
        IEnumerable<ProjectCustomType> ListProjectCustomTypes();

        [OperationContract]
        IEnumerable<ProjectCustomType> ListProjectCustomTypesByRef(int reference);

        [OperationContract]
        ProjectCustomType GetProjectCustomType(int id);




        [OperationContract]
        ProjectCustomTypeColumn CreateProjectCustomTypeColumn(ProjectCustomTypeColumn projectCustomTypeColumn);

        [OperationContract]
        ProjectCustomTypeColumn UpdateProjectCustomTypeColumn(ProjectCustomTypeColumn project);

        [OperationContract]
        void DeleteProjectCustomTypeColumn(ProjectCustomTypeColumn project);

        [OperationContract]
        IEnumerable<ProjectCustomTypeColumn> ListProjectCustomTypeColumns();

        [OperationContract]
        IEnumerable<ProjectCustomTypeColumn> ListProjectCustomTypeColumnsByRef(int reference);

        [OperationContract]
        ProjectCustomTypeColumn GetProjectCustomTypeColumn(int id);


        [OperationContract]
        ProjectMember CreateProjectMember(ProjectMember projectMember);

        [OperationContract]
        ProjectMember UpdateProjectMember(ProjectMember project);

        [OperationContract]
        void DeleteProjectMember(ProjectMember project);

        [OperationContract]
        IEnumerable<ProjectMember> ListProjectMembers();

        [OperationContract]
        IEnumerable<ProjectMember> ListProjectMembersByRef(int reference);

        [OperationContract]
        ProjectMember GetProjectMember(int id);



        [OperationContract]
        Issue CreateIssue(Issue issue);

        [OperationContract]
        Issue UpdateIssue(Issue project);

        [OperationContract]
        Issue UpdateWorkflowStatus(string issueId, string action);

        [OperationContract]
        void DeleteIssue(Issue project);

        [OperationContract]
        IEnumerable<Issue> ListIssues();

        [OperationContract]
        IEnumerable<Issue> SearchIssues(Issue issue);

        [OperationContract]
        Issue GetIssue(System.Guid id);

        [OperationContract]
        Issue GetIssueByWorkflowInstanceid(System.Guid workflowInstanceId);

        /// <summary>
        /// Task List listing
        /// </summary>
        /// <param name="userName">user name which to list out</param>
        /// <param name="stateName">You can pass in gabbage at the moment.</param>
        /// <returns></returns>
        [OperationContract]
        IEnumerable<Issue> TaskList(string userName, string stateName);



        [OperationContract]
        IssueAttachment CreateIssueAttachment(IssueAttachment issueAttachment);

        [OperationContract]
        IssueAttachment UpdateIssueAttachment(IssueAttachment project);

        [OperationContract]
        void DeleteIssueAttachment(IssueAttachment project);

        [OperationContract]
        IEnumerable<IssueAttachment> ListIssueAttachments();

        [OperationContract]
        IEnumerable<IssueAttachment> ListIssueAttachmentsByRef(System.Guid reference);

        [OperationContract]
        IssueAttachment GetIssueAttachment(System.Guid id);



        [OperationContract]
        IssueCustomTypeValue CreateIssueCustomTypeValue(IssueCustomTypeValue issueCustomTypeValue);

        [OperationContract]
        IssueCustomTypeValue UpdateIssueCustomTypeValue(IssueCustomTypeValue project);

        [OperationContract]
        void DeleteIssueCustomTypeValue(IssueCustomTypeValue project);

        [OperationContract]
        IEnumerable<IssueCustomTypeValue> ListIssueCustomTypeValues();

        [OperationContract]
        IEnumerable<IssueCustomTypeValue> ListIssueCustomTypeValuesByRef(System.Guid reference);

        [OperationContract]
        IssueCustomTypeValue GetIssueCustomTypeValue(System.Guid id);



        [OperationContract]
        IssueTask CreateIssueTask(IssueTask issueTask);

        [OperationContract]
        IssueTask UpdateIssueTask(IssueTask project);

        [OperationContract]
        void DeleteIssueTask(IssueTask project);

        [OperationContract]
        IEnumerable<IssueTask> ListIssueTasks();

        [OperationContract]
        IEnumerable<IssueTask> ListIssueTasksByRef(System.Guid reference);

        [OperationContract]
        IssueTask GetIssueTask(System.Guid id);




        [OperationContract]
        IssueWfHistory CreateIssueWfHistory(IssueWfHistory issueWfHistory);

        [OperationContract]
        IssueWfHistory UpdateIssueWfHistory(IssueWfHistory project);

        [OperationContract]
        void DeleteIssueWfHistory(IssueWfHistory project);

        [OperationContract]
        IEnumerable<IssueWfHistory> ListIssueWfHistories();

        [OperationContract]
        IEnumerable<IssueWfHistory> ListIssueWfHistoriesByRef(System.Guid reference);

        [OperationContract]
        IssueWfHistory GetIssueWfHistory(System.Guid id);

        [OperationContract]
        IDictionary<string, string> GetEventList(string currentStateName);
   
    }
}
